package com.hyacinth.netty.protocol;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 通用数据包
 * @author zhangfb
 * @version 1.0.0.1
 * @since JDK 1.8
 */
@NoArgsConstructor
@EqualsAndHashCode
@Data
public class CommonPacket {

    /**协议版本**/
    @JSONField(deserialize = false, serialize = false)
    private Byte version = 1;

    /**指令**/
    @JSONField(serialize = false)
    private Byte command;

    private long requestId;
    private String message;

    public CommonPacket(Byte command, long requestId, String message) {
        this.command = command;
        this.requestId = requestId;
        this.message = message;
    }
}
